/* 
 * File:   Server.cpp
 * Author: nrechten
 * 
 * Created on 18 April 2011, 16:30
 *
 * The server class and support classes manage the connection between the server
 * and the client on the server side.
 *
 */

#include "Server.h"
#include "TerrainDatasource.h"

Server::Server(SceneModel* sm) {
    terrain_datasource = new DummyTerrainDatasource();
    _sm = sm;
}

Server::~Server() {
    delete terrain_datasource;
}

void Server::load_block(UNIT* coord, UNIT coord_depth, UNIT lod){
//    printf ("Loading block from server:\n");
//    for(int i = 0; i < (coord_depth+1)*3; i++){
//        printf (" coord[%d]:%d\n",i,coord[i]);
//    }
    _sm->add_block_to_scene(coord,coord_depth,terrain_datasource->load_block(coord,coord_depth,lod));
}


